import { Component } from "react";
import { Route, Switch, Redirect } from "react-router-dom";

import Index from "../view/index/index";
import About from "../view/about/index";
import Book from "../view/book/index";
import User from "../view/user/index";
import Details from "../view/details/index";


class IndexRouter extends Component {
	render() {
		return (
			<Switch>
				<Route path="/" exact render={() => (<Redirect to="/index/all" />)} />
				<Route path="/index " exact render={() => (<Redirect to="/index/all" />)} />
				<Route path="/index/:id" component={Index} />
				<Route path="/about" component={About} />
				<Route path="/book" component={Book} />
				<Route path="/user" component={User} />
				<Route path="/details" component={Details} />
			</Switch>
		)
	}
}
export default IndexRouter;
